home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume10 / tgif / patch6.01 next >
Encoding:
Internet Message Format  |  1990-12-17  |  24.6 KB

  1. Path: uunet!bellcore!rutgers!usc!elroy.jpl.nasa.gov!lll-winken!sun-barr!newstop!exodus!CS.UCLA.EDU
  2. From: william@CS.UCLA.EDU (William Cheng)
  3. Newsgroups: comp.sources.x
  4. Subject: v10i064: tgif, Patch6, Part01/03
  5. Message-ID: <4698@exodus.Eng.Sun.COM>
  6. Date: 18 Dec 90 02:07:01 GMT
  7. References: <csx-10i064:tgif@uunet.UU.NET>
  8. Sender: news@exodus.Eng.Sun.COM
  9. Lines: 846
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: william@CS.UCLA.EDU (William Cheng)
  13. Posting-number: Volume 10, Issue 64
  14. Archive-name: tgif/patch6.01
  15. Patch-To: Volume 7, Issue 56-76 (original: tgif-1.2)
  16. Patch-To: Volume 8, Issue 46-48 (Patch1: tgif-1.2 => tgif-1.9)
  17. Patch-To: Volume 8, Issue 58-60 (Patch2: tgif-1.9 => tgif-1.12)
  18. Patch-To: Volume 8, Issue 87-89 (Patch3: tgif-1.12 => tgif-1.13)
  19. Patch-To: Volume 8, Issue 94 (Patch4: tgif-1.13 => tgif-1.14)
  20. Patch-To: Volume 8, Issue 95 (Patch5: tgif-1.14 => tgif-1.15)
  21.  
  22. Patch6 of tgif takes tgif-1.15 to tgif-1.16.  Below is a list of
  23. added features/bug fixes, followed by the actual patch.
  24.  
  25. tgif-1.15 => tgif-1.16
  26.  
  27. 1) Fix bugs related makeing a grouped object iconic.  Used to have the
  28.    wrong file name.
  29. 2) Remove the restriction of just being able to edit files under the
  30.    current directory.
  31. 3) New implementation of domains.  Now a domain specifies a search path
  32.    for the .sym files.
  33.  
  34. The following is the patch to take tgif from version 1.15 to 1.16.
  35. ---------------------------------> cut here <---------------------------------
  36. *** box.c.orig    Sat Oct 27 17:47:20 1990
  37. --- box.c    Sat Oct 27 17:47:21 1990
  38. ***************
  39. *** 6,10 ****
  40.   #ifndef lint
  41.   static char RCSid[] =
  42. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/box.c,v 1.7 90/08/13 09:23:32 william Exp $";
  43.   #endif
  44.   
  45. --- 6,10 ----
  46.   #ifndef lint
  47.   static char RCSid[] =
  48. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/box.c,v 1.8 90/10/27 15:09:43 william Exp $";
  49.   #endif
  50.   
  51. *** choice.c.orig    Sat Oct 27 17:47:26 1990
  52. --- choice.c    Sat Oct 27 17:47:27 1990
  53. ***************
  54. *** 6,10 ****
  55.   #ifndef lint
  56.   static char RCSid[] =
  57. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/choice.c,v 1.8 90/08/21 15:55:15 william Exp $";
  58.   #endif
  59.   
  60. --- 6,10 ----
  61.   #ifndef lint
  62.   static char RCSid[] =
  63. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/choice.c,v 1.9 90/10/27 15:12:25 william Exp $";
  64.   #endif
  65.   
  66. ***************
  67. *** 224,227 ****
  68. --- 224,240 ----
  69.      XFillRectangle (mainDisplay, choiceWindow, rasterGC, 3*choiceImageW, 0,
  70.            choiceImageW, choiceImageH);
  71. + /* XGCValues    values;
  72. +    XClearArea (mainDisplay, choiceWindow, 3*choiceImageW, 0,
  73. +          choiceImageW, choiceImageH, FALSE);
  74. +    if (curDash != 0)
  75. +       XSetDashes (mainDisplay, rasterGC, 0, dashList[curDash],
  76. +             dashListLength[curDash]);
  77. +    values.line_width = widthOfLine[lineWidth];
  78. +    XChangeGC (mainDisplay, rasterGC, GCLineWidth, &values);
  79. +    XDrawLine (mainDisplay, choiceWindow, rasterGC,
  80. +          3*choiceImageW+3, (int)(choiceImageH/2), 4*choiceImageW-3,
  81. +          (int)(choiceImageH/2)); */
  82.   }
  83.   
  84. *** color.c.orig    Sat Oct 27 17:47:33 1990
  85. --- color.c    Sat Oct 27 17:47:34 1990
  86. ***************
  87. *** 6,10 ****
  88.   #ifndef lint
  89.   static char RCSid[] =
  90. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/color.c,v 1.11 90/07/31 15:11:08 william Exp $";
  91.   #endif
  92.   
  93. --- 6,10 ----
  94.   #ifndef lint
  95.   static char RCSid[] =
  96. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/color.c,v 1.14 90/10/27 16:29:54 william Exp $";
  97.   #endif
  98.   
  99. ***************
  100. *** 28,31 ****
  101. --- 28,34 ----
  102.   int    * xorColorPixels = NULL;
  103.   char    * * colorMenuItems = NULL;
  104. + XColor    * tgifColors;
  105. + int    maxRGB = 0;
  106. + int    colorDump = FALSE;
  107.   
  108.   static char    * defaultColorMenuItems[MAXCOLORS] =
  109. ***************
  110. *** 63,67 ****
  111.      if (i == maxColors)
  112.      {
  113. !       printf ("Can not find color `%s', use `%s' instead.\n", s,
  114.               colorMenuItems[defaultColorIndex]);
  115.         return (defaultColorIndex);
  116. --- 66,70 ----
  117.      if (i == maxColors)
  118.      {
  119. !       printf ("Can not find color '%s', use '%s' instead.\n", s,
  120.               colorMenuItems[defaultColorIndex]);
  121.         return (defaultColorIndex);
  122. ***************
  123. *** 77,80 ****
  124. --- 80,84 ----
  125.      int        num, color_in_x_default = FALSE;
  126.      int        bg_allocated=FALSE, fg_allocated=FALSE, brdr_allocated=FALSE;
  127. +    int        tmp_max, white_allocated=FALSE, black_allocated=TRUE;
  128.   
  129.      if ((c_ptr = XGetDefault (mainDisplay, TOOL_NAME, "ReverseVideo")) != NULL)
  130. ***************
  131. *** 148,151 ****
  132. --- 152,157 ----
  133.      colorMenuItems = (char * *) calloc (maxColors, sizeof (char *));
  134.   
  135. +    tgifColors = (XColor *) calloc (maxColors, sizeof (XColor));
  136.      if (color_in_x_default)
  137.      {
  138. ***************
  139. *** 176,179 ****
  140. --- 182,189 ----
  141.                  &exact_def);
  142.            colorPixels[i] = color.pixel;
  143. +          tgifColors[i].red = color.red;
  144. +          tgifColors[i].green = color.green;
  145. +          tgifColors[i].blue = color.blue;
  146.      
  147.            if (strcmp (colorMenuItems[i], fg_color) == 0)
  148. ***************
  149. *** 248,251 ****
  150. --- 258,269 ----
  151.         colorIndex = 0;
  152.      }
  153. +    XAllocNamedColor(mainDisplay, mainColormap, "black", &color, &exact_def);
  154. +    tmp_max = max(color.red,max(color.green,color.blue));
  155. +    if (tmp_max > maxRGB) maxRGB = tmp_max;
  156. +    XAllocNamedColor(mainDisplay, mainColormap, "white", &color, &exact_def);
  157. +    tmp_max = max(color.red,max(color.green,color.blue));
  158. +    if (tmp_max > maxRGB) maxRGB = tmp_max;
  159. +    if (tmp_max == 0)
  160. +       printf ("Warning:  Unexpected maximum RGB intensity 0.");
  161.   }
  162.   
  163. *** copypaste.c.orig    Sat Oct 27 17:47:39 1990
  164. --- copypaste.c    Sat Oct 27 17:47:40 1990
  165. ***************
  166. *** 7,11 ****
  167.   #ifndef lint
  168.   static char RCSid[] =
  169. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/copypaste.c,v 1.8 90/08/25 17:26:51 william Exp $";
  170.   #endif
  171.   
  172. --- 7,11 ----
  173.   #ifndef lint
  174.   static char RCSid[] =
  175. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/copypaste.c,v 1.10 90/09/04 07:26:02 william Exp $";
  176.   #endif
  177.   
  178. ***************
  179. *** 219,225 ****
  180.         return;
  181.      }
  182. - #ifdef KANJI
  183. -       myPasteKanji (cut_buffer, len);
  184. - #endif
  185.      cut_buffer++;
  186.      len--;
  187. --- 219,222 ----
  188. *** cursor.c.orig    Sat Oct 27 17:47:45 1990
  189. --- cursor.c    Sat Oct 27 17:47:46 1990
  190. ***************
  191. *** 6,10 ****
  192.   #ifndef lint
  193.   static char RCSid[] =
  194. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/cursor.c,v 1.5 90/07/16 10:31:01 william Exp $";
  195.   #endif
  196.   
  197. --- 6,10 ----
  198.   #ifndef lint
  199.   static char RCSid[] =
  200. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/cursor.c,v 1.6 90/09/04 17:59:03 william Exp $";
  201.   #endif
  202.   
  203. ***************
  204. *** 17,20 ****
  205. --- 17,21 ----
  206.   #include "setup.e"
  207.   
  208. + #include "bitmaps/null.bm"
  209.   #include "bitmaps/nullmask.bm"
  210.   #include "bitmaps/text_cur_image.bm"
  211. ***************
  212. *** 29,32 ****
  213. --- 30,34 ----
  214.   static Pixmap    textPixmap;
  215.   static Pixmap    nullPixmap;
  216. + static Pixmap    nullMaskPixmap;
  217.   
  218.   static XImage    * textCursorImage;
  219. ***************
  220. *** 85,91 ****
  221.      handCursor = XCreateFontCursor (mainDisplay, XC_hand2);
  222.   
  223. !    nullPixmap = XCreatePixmap (mainDisplay, mainWindow, nullmask_width,
  224.            nullmask_height, 1);
  225. !    nullCursor = XCreatePixmapCursor (mainDisplay, nullPixmap, nullPixmap,
  226.            &color, &color, 0, 0);
  227.   }
  228. --- 87,95 ----
  229.      handCursor = XCreateFontCursor (mainDisplay, XC_hand2);
  230.   
  231. !    nullPixmap = XCreatePixmap (mainDisplay, mainWindow, null_width,
  232. !          null_height, 1);
  233. !    nullMaskPixmap = XCreatePixmap (mainDisplay, mainWindow, nullmask_width,
  234.            nullmask_height, 1);
  235. !    nullCursor = XCreatePixmapCursor (mainDisplay, nullPixmap, nullMaskPixmap,
  236.            &color, &color, 0, 0);
  237.   }
  238. ***************
  239. *** 112,115 ****
  240. --- 116,120 ----
  241.   
  242.      XFreePixmap (mainDisplay, nullPixmap);
  243. +    XFreePixmap (mainDisplay, nullMaskPixmap);
  244.      XFreeCursor (mainDisplay, nullCursor);
  245.   }
  246. *** file.c.orig    Sat Oct 27 17:48:07 1990
  247. --- file.c    Sat Oct 27 17:48:08 1990
  248. ***************
  249. *** 6,10 ****
  250.   #ifndef lint
  251.   static char RCSid[] =
  252. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.c,v 1.32 90/08/15 16:00:43 william Exp $";
  253.   #endif
  254.   
  255. --- 6,10 ----
  256.   #ifndef lint
  257.   static char RCSid[] =
  258. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/file.c,v 1.38 90/10/27 15:07:35 william Exp $";
  259.   #endif
  260.   
  261. ***************
  262. *** 49,52 ****
  263. --- 49,54 ----
  264.   #define START_HAVING_ATTRS 8
  265.   
  266. + extern char    * getenv ();
  267.   char    curFileName[MAXPATHLENGTH];
  268.   int    curFileDefined = FALSE;
  269. ***************
  270. *** 67,70 ****
  271. --- 69,73 ----
  272.      curFileName[0] = '\0';
  273.      curFileDefined = FALSE;
  274. +    *curSymDir = '\0';
  275.   }
  276.   
  277. ***************
  278. *** 184,188 ****
  279.   {
  280.      char            new_file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
  281. !    char            new_full_name[MAXPATHLENGTH];
  282.      FILE            * fp;
  283.      int            count = 0, len;
  284. --- 187,191 ----
  285.   {
  286.      char            new_file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
  287. !    char            new_full_name[MAXPATHLENGTH], tmp_str[MAXPATHLENGTH];
  288.      FILE            * fp;
  289.      int            count = 0, len;
  290. ***************
  291. *** 243,249 ****
  292.      }
  293.   
  294. !    strcpy (new_full_name, curDomainName);
  295. !    if (*curDomainName != '\0') strcat (new_full_name, "/");
  296. !    strcat (new_full_name, new_file_name);
  297.   
  298.      if (!OkayToCreateFile (new_full_name)) return;
  299. --- 246,257 ----
  300.      }
  301.   
  302. !    if (*new_file_name == '/')
  303. !       strcat (new_full_name, new_file_name);
  304. !    else
  305. !    {
  306. !       strcpy (new_full_name, curDir);
  307. !       strcat (new_full_name, "/");
  308. !       strcat (new_full_name, new_file_name);
  309. !    }
  310.   
  311.      if (!OkayToCreateFile (new_full_name)) return;
  312. ***************
  313. *** 256,266 ****
  314.      }
  315.   
  316. !    strcpy (curFileName, new_file_name);
  317.      curFileDefined = TRUE;
  318. !    sprintf (s, "Saving '%s' ...", new_file_name);
  319.      Msg (s);
  320.      Save (fp, botObj, 0);
  321.      fclose (fp);
  322. !    sprintf (s, "File '%s' saved.", new_file_name);
  323.      Msg (s);
  324.      SetFileModified (FALSE);
  325. --- 264,279 ----
  326.      }
  327.   
  328. !    strcpy (tmp_str, curDir);
  329. !    SetCurDir (new_full_name);
  330. !    *curSymDir = '\0';
  331.      curFileDefined = TRUE;
  332. !    if (strcmp (tmp_str, curDir) != 0) UpdateDirInfo ();
  333. !    sprintf (s, "Saving '%s/%s' ...", curDir, curFileName);
  334.      Msg (s);
  335.      Save (fp, botObj, 0);
  336.      fclose (fp);
  337. !    sprintf (s, "File '%s/%s' saved.", curDir, curFileName);
  338.      Msg (s);
  339.      SetFileModified (FALSE);
  340. ***************
  341. *** 314,323 ****
  342.      }
  343.   
  344. !    strcpy (full_name, curDomainName);
  345. !    if (*curDomainName != '\0') strcat (full_name, "/");
  346. !    strcat (full_name, curFileName);
  347.      if ((fp = fopen (full_name, "w")) == NULL)
  348.      {
  349. !       sprintf (s, "Can not open %s, file not saved.", curFileName);
  350.         Msg (s);
  351.         return;
  352. --- 327,346 ----
  353.      }
  354.   
  355. !    if (strcmp (ext, "sym") == 0)
  356. !    {
  357. !       strcpy (full_name, curSymDir);
  358. !       strcat (full_name, "/");
  359. !       strcat (full_name, curFileName);
  360. !    }
  361. !    else if (strcmp (ext, "obj") == 0)
  362. !    {
  363. !       strcpy (full_name, curDir);
  364. !       strcat (full_name, "/");
  365. !       strcat (full_name, curFileName);
  366. !    }
  367.      if ((fp = fopen (full_name, "w")) == NULL)
  368.      {
  369. !       sprintf (s, "Can not open '%s', file not saved.", full_name);
  370.         Msg (s);
  371.         return;
  372. ***************
  373. *** 324,328 ****
  374.      }
  375.   
  376. !    sprintf (s, "Saving '%s' ...", curFileName);
  377.      Msg (s);
  378.   
  379. --- 347,351 ----
  380.      }
  381.   
  382. !    sprintf (s, "Saving '%s' ...", full_name);
  383.      Msg (s);
  384.   
  385. ***************
  386. *** 330,334 ****
  387.   
  388.      fclose (fp);
  389. !    sprintf (s, "File '%s' saved.", curFileName);
  390.      Msg (s);
  391.      SetFileModified (FALSE);
  392. --- 353,357 ----
  393.   
  394.      fclose (fp);
  395. !    sprintf (s, "File '%s' saved.", full_name);
  396.      Msg (s);
  397.      SetFileModified (FALSE);
  398. ***************
  399. *** 424,428 ****
  400.            if (colorIndex >= maxColors)
  401.            {
  402. !             printf ("Can not find color `%s', use `%s' instead.\n", s,
  403.                     colorMenuItems[defaultColorIndex]);
  404.               colorIndex = defaultColorIndex;
  405. --- 447,451 ----
  406.            if (colorIndex >= maxColors)
  407.            {
  408. !             printf ("Can not find color '%s', use `%s' instead.\n", s,
  409.                     colorMenuItems[defaultColorIndex]);
  410.               colorIndex = defaultColorIndex;
  411. ***************
  412. *** 615,656 ****
  413.   void ChangeDomain ()
  414.   {
  415. -    char     domain_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
  416.      register int    i;
  417.   
  418.      if (SelectDomain (domain_name) == INVALID) return;
  419.   
  420. !    if (strcmp (domain_name, "..") == 0)
  421. !    {
  422. !       if (*curDomainName == '\0')
  423. !          Msg ("Already at the top.  Domain not changed.");
  424. !       else
  425. !       {
  426. !          i = strlen (curDomainName) - 1;
  427. !          for ( ; i >= 0 && curDomainName[i] != '/'; i--) ;
  428. !          if (i >= 0)
  429. !          {
  430. !             curDomainName[i] = '\0';
  431. !             sprintf (s, "Current domain is %s.", curDomainName);
  432. !             Msg (s);
  433. !          }
  434. !          else
  435. !          {
  436. !             curDomainName[0] = '\0';
  437. !             Msg ("At the top of the domain hierarchy.");
  438. !          }
  439. !       }
  440. !    }
  441. !    else if (strcmp (domain_name, ".") == 0)
  442. !    {
  443. !       sprintf (s, "Current domain is %s.", curDomainName);
  444. !       Msg (s);
  445. !    }
  446.      else
  447. !    {
  448. !       if (*curDomainName != '\0') strcat (curDomainName, "/");
  449. !       strcat (curDomainName, domain_name);
  450. !       sprintf (s, "Current domain is %s.", curDomainName);
  451. !       Msg (s);
  452. !    }
  453.   }
  454.   
  455. --- 638,659 ----
  456.   void ChangeDomain ()
  457.   {
  458.      register int    i;
  459. +    char     domain_name[MAXPATHLENGTH], env_str[MAXPATHLENGTH];
  460. +    char     s[MAXSTRING], s1[MAXSTRING], * c_ptr;
  461.   
  462.      if (SelectDomain (domain_name) == INVALID) return;
  463.   
  464. !    sprintf (env_str, "TGIF_%s", domain_name);
  465. !    if ((c_ptr = getenv (env_str)) == NULL)
  466. !       ParseSymPath (".");
  467.      else
  468. !       ParseSymPath (c_ptr);
  469. !    UpdateSymInfo ();
  470. !    strcpy (curDomainName, domain_name);
  471. !    sprintf (s, "Current domain is '%s'.", curDomainName);
  472. !    sprintf (s1, "Symbol path set to '%s'.", curDomainPath);
  473. !    TwoLineMsg (s, s1);
  474.   }
  475.   
  476. ***************
  477. *** 659,674 ****
  478.      struct ObjRec    * obj_ptr, * saved_top_obj, * saved_bot_obj;
  479.      char         file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
  480. -    char         full_name[MAXPATHLENGTH];
  481.      FILE            * fp;
  482.   
  483. !    if (SelectFileName ("obj", "Please Select A File To IMPORT ...",
  484. !          file_name) == INVALID) return;
  485.   
  486.      strcat (file_name, ".obj");
  487. -    strcpy (full_name, curDomainName);
  488. -    if (*curDomainName != '\0') strcat (full_name, "/");
  489. -    strcat (full_name, file_name);
  490.   
  491. !    if ((fp = fopen (full_name, "r")) == NULL)
  492.      {
  493.         sprintf (s, "Can not import '%s'.", file_name);
  494. --- 662,674 ----
  495.      struct ObjRec    * obj_ptr, * saved_top_obj, * saved_bot_obj;
  496.      char         file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
  497.      FILE            * fp;
  498.   
  499. !    if (SelectFileName ("Please select a file to IMPORT ...", file_name)
  500. !          == INVALID)
  501. !       return;
  502.   
  503.      strcat (file_name, ".obj");
  504.   
  505. !    if ((fp = fopen (file_name, "r")) == NULL)
  506.      {
  507.         sprintf (s, "Can not import '%s'.", file_name);
  508. ***************
  509. *** 720,732 ****
  510.      FILE            * fp;
  511.   
  512. !    if (SelectFileName ("obj", "Please Select A File To OPEN ...",
  513. !          file_name) == INVALID) return;
  514.   
  515.      strcat (file_name, ".obj");
  516. -    strcpy (full_name, curDomainName);
  517. -    if (*curDomainName != '\0') strcat (full_name, "/");
  518. -    strcat (full_name, file_name);
  519.   
  520. !    if ((fp = fopen (full_name, "r")) == NULL)
  521.      {
  522.         sprintf (s, "Can not open '%s'.", file_name);
  523. --- 720,729 ----
  524.      FILE            * fp;
  525.   
  526. !    if (SelectFileName ("Please select a file to OPEN ...",file_name) == INVALID)
  527. !       return;
  528.   
  529.      strcat (file_name, ".obj");
  530.   
  531. !    if ((fp = fopen (file_name, "r")) == NULL)
  532.      {
  533.         sprintf (s, "Can not open '%s'.", file_name);
  534. ***************
  535. *** 758,762 ****
  536.   
  537.      fclose (fp);
  538. !    strcpy (curFileName, file_name);
  539.      curFileDefined = TRUE;
  540.   
  541. --- 755,760 ----
  542.   
  543.      fclose (fp);
  544. !    SetCurDir (file_name);
  545. !    *curSymDir = '\0';
  546.      curFileDefined = TRUE;
  547.   
  548. ***************
  549. *** 1012,1017 ****
  550.               }
  551.   
  552. !             strcpy (ps_file, curDomainName);
  553. !             if (*curDomainName != '\0') strcat (ps_file, "/");
  554.               strcat (ps_file, curFileName);
  555.               len = strlen (ps_file);
  556. --- 1010,1015 ----
  557.               }
  558.   
  559. !             strcpy (ps_file, curDir);
  560. !             strcat (ps_file, "/");
  561.               strcat (ps_file, curFileName);
  562.               len = strlen (ps_file);
  563. *** font.c.orig    Sat Oct 27 17:48:30 1990
  564. --- font.c    Sat Oct 27 17:48:31 1990
  565. ***************
  566. *** 6,10 ****
  567.   #ifndef lint
  568.   static char RCSid[] =
  569. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.c,v 1.9 90/08/16 15:44:24 william Exp $";
  570.   #endif
  571.   
  572. --- 6,10 ----
  573.   #ifndef lint
  574.   static char RCSid[] =
  575. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/font.c,v 1.11 90/10/27 15:45:24 william Exp $";
  576.   #endif
  577.   
  578. ***************
  579. *** 25,35 ****
  580.   #include "text.e"
  581.   
  582. - #define COUR8R  24
  583. - #define COUR10R 25
  584. - #define COUR12R 26
  585. - #define COUR14R 27
  586. - #define COUR18R 28
  587. - #define COUR24R 29
  588.   #define FONTS_PER_DPI (((MAXFONTS-1)*MAXFONTSTYLES+1)*MAXFONTSIZES)
  589.   #define FONTTABLESIZE (MAXFONTDPIS*FONTS_PER_DPI)
  590. --- 25,28 ----
  591. ***************
  592. *** 37,40 ****
  593. --- 30,47 ----
  594.   /* #define FONTTABLESIZE (MAXFONTSIZES*MAXFONTSTYLES*MAXFONTS) */
  595.   
  596. + #define COUR8R_75  FontIndex(FONT_DPI_75,FONT_COU,0,STYLE_NR)
  597. + #define COUR10R_75 FontIndex(FONT_DPI_75,FONT_COU,1,STYLE_NR)
  598. + #define COUR12R_75 FontIndex(FONT_DPI_75,FONT_COU,2,STYLE_NR)
  599. + #define COUR14R_75 FontIndex(FONT_DPI_75,FONT_COU,3,STYLE_NR)
  600. + #define COUR18R_75 FontIndex(FONT_DPI_75,FONT_COU,4,STYLE_NR)
  601. + #define COUR24R_75 FontIndex(FONT_DPI_75,FONT_COU,5,STYLE_NR)
  602. + #define COUR11R_100 FontIndex(FONT_DPI_100,FONT_COU,0,STYLE_NR)
  603. + #define COUR14R_100 FontIndex(FONT_DPI_100,FONT_COU,1,STYLE_NR)
  604. + #define COUR17R_100 FontIndex(FONT_DPI_100,FONT_COU,2,STYLE_NR)
  605. + #define COUR20R_100 FontIndex(FONT_DPI_100,FONT_COU,3,STYLE_NR)
  606. + #define COUR25R_100 FontIndex(FONT_DPI_100,FONT_COU,4,STYLE_NR)
  607. + #define COUR34R_100 FontIndex(FONT_DPI_100,FONT_COU,5,STYLE_NR)
  608.   struct MyFontRec {
  609.      XFontStruct    * xfs;
  610. ***************
  611. *** 382,385 ****
  612. --- 389,393 ----
  613.   {
  614.      register int    i;
  615. +    int        ruler_index, default_index;
  616.   
  617.      pointSize = (curFontDPI==FONT_DPI_75) ? pointSize75 : pointSize100;
  618. ***************
  619. *** 388,404 ****
  620.      for (i = 0; i < FONTTABLESIZE; i++) myFontInfo[i].valid = FALSE;
  621.   
  622. !    if ((myFontInfo[COUR18R].xfs =
  623. !          XLoadQueryFont (mainDisplay, fontNameStr[COUR18R])) == NULL)
  624. !    { printf ("Can not open %s.  Abort.\n\n", fontNameStr[COUR18R]); exit (-1); }
  625.   
  626. !    myFontInfo[COUR18R].valid = TRUE;
  627.   
  628. !    if ((myFontInfo[COUR10R].xfs =
  629. !          XLoadQueryFont (mainDisplay, fontNameStr[COUR10R])) == NULL)
  630. !    { printf ("Can not open %s.  Abort.\n\n", fontNameStr[COUR10R]); exit (-1); }
  631.   
  632. !    myFontInfo[COUR10R].valid = TRUE;
  633. !    rulerFontPtr = myFontInfo[COUR10R].xfs;
  634.      rulerFontWidth = rulerFontPtr->max_bounds.width;
  635.      rulerFontAsc = rulerFontPtr->max_bounds.ascent;
  636. --- 396,445 ----
  637.      for (i = 0; i < FONTTABLESIZE; i++) myFontInfo[i].valid = FALSE;
  638.   
  639. !    default_index = COUR18R_75;
  640. !    if ((myFontInfo[default_index].xfs =
  641. !          XLoadQueryFont (mainDisplay, fontNameStr[default_index])) == NULL)
  642. !    {
  643. !       default_index = COUR17R_100;
  644. !       if ((myFontInfo[default_index].xfs =
  645. !             XLoadQueryFont (mainDisplay, fontNameStr[default_index])) == NULL)
  646. !       {
  647. !          printf ("Can not open %s or %s.  Abort.\n\n",
  648. !                fontNameStr[COUR18R_75], fontNameStr[COUR17R_100]);
  649. !          exit (-1);
  650. !       }
  651. !    }
  652. !    myFontInfo[default_index].valid = TRUE;
  653.   
  654. !    if (default_index == COUR18R_75)
  655. !    {
  656. !       ruler_index = COUR10R_75;
  657. !       if ((myFontInfo[ruler_index].xfs =
  658. !             XLoadQueryFont (mainDisplay, fontNameStr[ruler_index])) == NULL)
  659. !       {
  660. !          printf ("Can not open %s.  Abort.\n\n", fontNameStr[ruler_index]);
  661. !          exit (-1);
  662. !       }
  663. !       curFontDPI = FONT_DPI_75;
  664. !    }
  665. !    else
  666. !    {
  667. !       ruler_index = COUR11R_100;
  668. !       if ((myFontInfo[ruler_index].xfs =
  669. !             XLoadQueryFont (mainDisplay, fontNameStr[ruler_index])) == NULL)
  670. !       {
  671. !          printf ("Can not open %s.  Abort.\n\n", fontNameStr[ruler_index]);
  672. !          exit (-1);
  673. !       }
  674. !       curFontDPI = FONT_DPI_100;
  675. !    }
  676. !    myFontInfo[ruler_index].valid = TRUE;
  677.   
  678. !    defaultFontPtr = myFontInfo[default_index].xfs;
  679. !    defaultFontWidth = defaultFontPtr->max_bounds.width;
  680. !    defaultFontAsc = defaultFontPtr->max_bounds.ascent;
  681. !    defaultFontDes = defaultFontPtr->max_bounds.descent;
  682. !    defaultFontHeight = defaultFontAsc + defaultFontDes;
  683.   
  684. !    rulerFontPtr = myFontInfo[ruler_index].xfs;
  685.      rulerFontWidth = rulerFontPtr->max_bounds.width;
  686.      rulerFontAsc = rulerFontPtr->max_bounds.ascent;
  687. ***************
  688. *** 405,414 ****
  689.      rulerFontDes = rulerFontPtr->max_bounds.descent;
  690.      rulerFontHeight = rulerFontAsc + rulerFontDes;
  691. -    defaultFontPtr = myFontInfo[COUR18R].xfs;
  692. -    defaultFontWidth = defaultFontPtr->max_bounds.width;
  693. -    defaultFontAsc = defaultFontPtr->max_bounds.ascent;
  694. -    defaultFontDes = defaultFontPtr->max_bounds.descent;
  695. -    defaultFontHeight = defaultFontAsc + defaultFontDes;
  696.   }
  697.   
  698. --- 446,449 ----
  699. *** frontend.c.orig    Sat Oct 27 17:48:35 1990
  700. --- frontend.c    Sat Oct 27 17:48:36 1990
  701. ***************
  702. *** 0 ****
  703. --- 1,13 ----
  704. + /*
  705. +  * Author:    William Chia-Wei Cheng (william@cs.ucla.edu)
  706. +  *
  707. +  * Copyright (C) 1990, William Cheng.
  708. +  */
  709. + #ifndef lint
  710. + static char RCSid[] =
  711. +       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/frontend.c,v 1.1 90/08/28 09:56:33 william Exp $";
  712. + #endif
  713. + int    lastFile;
  714. + short    * pDrawFontAsc;
  715. + short    * pDrawFontDes;
  716. *** mainloop.c.orig    Sat Oct 27 17:48:42 1990
  717. --- mainloop.c    Sat Oct 27 17:48:43 1990
  718. ***************
  719. *** 6,10 ****
  720.   #ifndef lint
  721.   static char RCSid[] =
  722. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/mainloop.c,v 1.15 90/08/16 09:35:09 william Exp $";
  723.   #endif
  724.   
  725. --- 6,10 ----
  726.   #ifndef lint
  727.   static char RCSid[] =
  728. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/mainloop.c,v 1.20 90/10/25 15:02:22 william Exp $";
  729.   #endif
  730.   
  731. ***************
  732. *** 42,46 ****
  733.   char    initMsg1[80], initMsg2[80];
  734.   
  735. ! static quitDraw = TRUE;
  736.   
  737.   static
  738. --- 42,46 ----
  739.   char    initMsg1[80], initMsg2[80];
  740.   
  741. ! static int    quitDraw = TRUE;
  742.   
  743.   static
  744. ***************
  745. *** 150,154 ****
  746.   {
  747.      XEvent        input, ev;
  748. !    char            * c_ptr, file_name[256], s[256];
  749.      int            shorthand_rc, draw_rc;
  750.      struct ObjRec    * obj_ptr;
  751. --- 150,155 ----
  752.   {
  753.      XEvent        input, ev;
  754. !    char            * c_ptr, file_name[MAXPATHLENGTH], s[MAXPATHLENGTH];
  755. !    char            full_name[MAXPATHLENGTH];
  756.      int            shorthand_rc, draw_rc;
  757.      struct ObjRec    * obj_ptr;
  758. ***************
  759. *** 199,203 ****
  760.   
  761.               fclose (fp);
  762. !             strcpy (curFileName, file_name);
  763.               curFileDefined = TRUE;
  764.   
  765. --- 200,214 ----
  766.   
  767.               fclose (fp);
  768. !             if (*file_name == '/')
  769. !                strcat (full_name, file_name);
  770. !             else
  771. !             {
  772. !                strcpy (full_name, curDir);
  773. !                strcat (full_name, "/");
  774. !                strcat (full_name, file_name);
  775. !             }
  776. !             SetCurDir (full_name);
  777. !             *curSymDir = '\0';
  778.               curFileDefined = TRUE;
  779.   
  780. ***************
  781. *** 207,210 ****
  782. --- 218,222 ----
  783.            }
  784.         }
  785. +       UpdateDirInfo ();
  786.      }
  787.      SaveDrawWinInfo ();
  788. *** menu.c.orig    Sat Oct 27 17:48:53 1990
  789. --- menu.c    Sat Oct 27 17:48:55 1990
  790. ***************
  791. *** 6,10 ****
  792.   #ifndef lint
  793.   static char RCSid[] =
  794. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/menu.c,v 1.12 90/08/15 16:00:27 william Exp $";
  795.   #endif
  796.   
  797. --- 6,10 ----
  798.   #ifndef lint
  799.   static char RCSid[] =
  800. !       "@(#)$Header: /n/kona/u/tangram/u/william/X11/TGIF/RCS/menu.c,v 1.14 90/10/25 14:58:18 william Exp $";
  801.   #endif
  802.   
  803. ***************
  804. *** 485,493 ****
  805.      if (curFileDefined)
  806.      {
  807. !       strcpy (file_name, curFileName);
  808. !       strcpy (s, curDomainName);
  809. !       if (*curDomainName != '\0') strcat (s, "/");
  810. !       strcat (s, file_name);
  811.      }
  812.   
  813.      if (fileModified) strcat (s, " [Modified]");
  814. --- 485,495 ----
  815.      if (curFileDefined)
  816.      {
  817. !       if (*curSymDir == '\0')
  818. !          sprintf (s, "%s:%s/%s", curDomainName, curDir, curFileName);
  819. !       else
  820. !          sprintf (s, "%s:%s/%s", curDomainName, curSymDir, curFileName);
  821.      }
  822. +    else
  823. +       sprintf (s, "%s:[Unnamed]", curDomainName);
  824.   
  825.      if (fileModified) strcat (s, " [Modified]");
  826. ---------------------------------> cut here <---------------------------------
  827. -- 
  828. Bill Cheng // UCLA Computer Science Department // (213) 206-7135
  829. 3277 Boelter Hall // Los Angeles, California 90024 // USA
  830. william@CS.UCLA.EDU      ...!{uunet|ucbvax}!cs.ucla.edu!william
  831.  
  832. dan
  833. ----------------------------------------------------
  834. O'Reilly && Associates   argv@sun.com / argv@ora.com
  835. Opinions expressed reflect those of the author only.
  836. --
  837. dan
  838. ----------------------------------------------------
  839. O'Reilly && Associates   argv@sun.com / argv@ora.com
  840. Opinions expressed reflect those of the author only.
  841.